﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MineSweeper
{
    public class MineButton : Button
    {
        public MineButtonState State { get; set; }
        public int Value { get; set; } // bomb = 9
        public bool Bomb { get; set; }
        public bool Selected = false;
        public List<Point> Neighbours { get; set; }

        public new Image Image
        {
            get { return base.Image; }
            set
            {
                if (value == null)
                {
                    base.Image = null;
                    return;
                }
                    
                Image newImage = new Bitmap(Width, Height);
                using (Graphics g = Graphics.FromImage(newImage))
                {
                    g.DrawImage(value, 0, 0, Width, Height);
                }
                base.Image = newImage;
            }
        }
    }

    public enum MineButtonState
    {
        Unselected,
        Flagged,
        Question
    }


}
